﻿/****************************** Module Header ******************************\
 * Module Name:  mxTextBox.cs
 * Module Version:  1.0.0 (2012-11-20)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This class is used to extension Form instance's method.  It supplies 
 * public static extension methods to load data or get othor control.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System.Windows.Forms;
using System.Drawing;

namespace UCL.Forms
{
    public static class mxTextBox
    {
        /// <summary>
        /// 使控件不可编辑
        /// </summary>
        /// <param name="c"></param>
        public static void Lock(this TextBoxBase c)
        {
            c.ReadOnly = true;
            c.BackColor = Color.White;
            c.ForeColor = Color.Black;
        }

        /// <summary>
        /// 使控件可编辑
        /// </summary>
        /// <param name="c"></param>
        public static void UnLock(this TextBoxBase c)
        {
            c.ReadOnly = false;
        }
    }
}
